#检测 tag
execute as @a[x=-18,y=65,z=-5,distance=..2] at @s if block -18 65 -5 minecraft:stone_pressure_plate[powered=true] run tag @s add parkour_start
#检测玩家掉落
execute as @a[tag=parkour_start,scores={height=..60}] at @s run function fisland:lobby/parkour/failed
#运行计时
scoreboard players add @a[tag=parkour_start] time 1
execute as @a[tag=parkour_start] at @s run scoreboard players operation @s time_s = @s time
scoreboard players operation @a[tag=parkour_start] time_s /= $20 time
#显示时间
execute as @a[tag=parkour_start] at @s run title @s actionbar [{"text":"Time :","color":"gold","bold":true,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"score":{"objective":"time_s","name":"@s"},"color":"red","bold":false,"italic":false,"underlined":true,"strikethrough":false,"obfuscated":false},{"text":"s","color":"gold","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false}]
#检测完成
execute as @a[x=-7,y=71,z=14,distance=..1,tag=parkour_start] at @s run function fisland:lobby/parkour/finish
#如果进入空岛 取消计时
execute as @a[tag=parkour_start,nbt=!{Dimension:"minecraft:overworld"}] at @s run tag @s remove parkour_start